<?php
class KhuyenmaiController extends Controller
{
    public function view1()
    {
        $this->assign('rows', $this->_model->getKhuyenMai());
    }

    public function showkm($idkm)
    {


        $loai_giatri = true;
        $dt = new Dienthoai();
        $data = $this->_model->getChiTietkm($idkm, $loai_giatri);
        $this->assign('km_giatri', $loai_giatri);

        foreach ($data as &$item) {

            $item['h_url'] = $dt->getDienthoaiFirstImage($item['dt_id']);
        }

        $this->assign(array(
            'list' => $data,
            'km_ten' => $this->_model->getTenKm($idkm)
        ));
    }
}